//声明对象：json
var jack = {
    name: 'jack',
    age: 18,
    address:'四川乐山'
}
/*
console.log(jack.name)
console.log(jack.age)
console.log(jack.address)*/

var rose = {
    name: 'rose',
    age: 19,
    address:'乐山大佛'
}
//对象数组
var personArray = [
    jack,
    rose
]
//遍历数组
/*
for (let i = 0; i < personArray.length; i++) {
    console.log(personArray[i].name);
    console.log(personArray[i].age);
    console.log(personArray[i].address);
}*/
personArray.forEach((stu,index)=>{
    console.log(index+':')
    console.log(stu)
})


